import { PrismaClient } from '@prisma/client';
import { hash } from 'bcryptjs';

const prisma = new PrismaClient();

async function main() {
  const hashedPassword = await hash('system', 12);
  
  await prisma.user.update({
    where: { username: 'system' },
    data: { password: hashedPassword }
  });
  
  console.log('系统用户密码已更新');
}

main()
  .catch((e) => {
    console.error('更新密码失败:', e);
    process.exit(1);
  })
  .finally(async () => {
    await prisma.$disconnect();
  }); 